<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <meta name="viewport" content="initial-scale=1.0,maximum-scale=1,minimum-scale=1,user-scalable= no,target-densitydpi =medium-dpi">
    <meta name="format-detection" content="telephone=no">
    <meta name="apple-touch-fullscreen" content="YES">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <title>持仓透视</title>
    <link rel="stylesheet" href="/common/styles/base.css" />
    <link rel="stylesheet" href="css/main.css" />
    <script src="/common/vendor/flexible-0.3.2/flexible.js"></script>
    <script type="text/javascript" src="/common/vendor/talkingdata/TalkingData.js"></script>  
<!--     <script src="http://160.6.76.186:8080/target/target-script-min.js#anonymous"></script>   -->
</head>

<body>
    <div class="container"></div>
</body>
<script data-main="js/main" src="/common/vendor/require-2.1.11/require.min.js"></script>
<script type="tpl/javascript" id="main-empty-tpl">
<div class="empty503">
    <h3 class="title">页面已经离开地球</h3>
    <div class="content"><img src="" id="img"></div>
    <div class="empty-footer">
        <div class="reload">刷新</div>
        <div class="reback">返回</div>  
    </div>
</div>
</script>
<script type="tpl/javascript" id="main-tpl">
<header class="header">
    <!--<div class="header-title">持仓 <span class="dot">·</span> 综合分析</div>-->
    <div class="data-picker">
        <div class="date-select">
            <div class="txt">选择日期:</div>            
            <div class="date half-line close"><%=dataHandling.formatDate(data.startDate,4)%> - <%=dataHandling.formatDate(data.endDate,4)%></div>
        </div>
        <ul class="date-segment hidden">
            <%_.each(data.dateList,function(item,index){%>
            <li class="time-quantum<%if(index===data.dateIndex){print(" active")}%>" data-flag="<%=item.flag%>">
                <div class="box half-line-bottom">                    
                    <div class="type"><%=item.name%></div>
                    <div class="txt"><%=item.startDate%> - <%=item.endDate%></div>                                
                </div>
            </li>
            <%})%>
            <li class="time-quantum<%if(data.dateIndex===3){print(" active")}%>" data-url="customTimeUrl">
                <div class="box">
                    <div class="type">自定义时间</div>
                    <div class="txt">可选择任意时间段</div>
                </div>
            </li>
        </ul>
    </div>
</header>
<article class="main">
    <%if(!data.earningsExplain.list.length){%>
        <div class="half-line no-hold">
            <div class="empty">
                <p>在此期间内，暂无持仓股票</p>
            </div>
        </div>   
        <footer class="main-footer fixed-bottom">
            <div class="txt"><font class="pingfang-sc-medium tip">【风险揭示】</font>由于时间跨度、手续费及分红、转增、配股到账时间等原因，可能导致本功能数据不准确。以上数据仅供参考，不作为您投资决策依据，最终以实际交割单为准。市场有风险，投资需谨慎。</div>
        </footer>             
    <%}else{%>
    <div class="gross-income bottom-line">
        <div class="txt">期间持仓总收益(<%=data.currency%>)</div>
        <div class="count"><%=data.accountInfo.income%></div>
        <ul class="info">
            <li class="item">收益率 <%=data.accountInfo.incomePercent%></li>
            <%if(data.accountInfo.win){%>
            <li class="item">跑赢<%=data.accountInfo.win%>的股友</li>
            <%}%>            
        </ul>
    </div>
    <div class="income-analysis bottom-line">
        <div class="label">
            <span class="title">收益分析</span>
            <div class="content"><span class="basic-facts">【盈利概况】</span>期间共持有<%=data.earningsExplain.totalNum%>只股票，总盈利<%=data.earningsExplain.addProfit%><%=data.currency%>，总亏损<%=data.earningsExplain.lossProfit.replace(/-/gi,"")%><%=data.currency%>，最大投入成本<%=data.earningsExplain.maxIncome%><%=data.currency%></div>
            <div class="comparison">
                <div class="profit-info info half-line">
                    <%if(Number(data.earningsExplain.addProfit)){%>
                        <div class="profit-tab half-line-bottom">
                            <span>盈利最多</span><%=data.earningsExplain.productInfo.maxTradingName%>
                        </div>
                        <p><%=data.earningsExplain.productInfo.maxProfitValue%></p>
                        <div class="triangle"></div>                        
                    <%}else{%>
                        <div class="profit-tab half-line-bottom align-center">
                             期间暂无盈利
                        </div>
                        <p class="align-center color-999">0.00</p>
                        <div class="triangle"></div>                        
                    <%}%>
                </div>
                <div class="profit-wrap<%=Number(data.earningsExplain.addProfit)?"":" lower-png"%>">
                    <div class="profit-column radius-t" style="height:<%=data.earningsExplain.percent.addCountPercent%>%"></div>                
                    <div class="profit-most<%=dataHandling.percentOptimize(data.earningsExplain.percent.addCountPercent,data.earningsExplain.percent.addPercent).className%>" style="height:<%=dataHandling.percentOptimize(data.earningsExplain.percent.addCountPercent,data.earningsExplain.percent.addPercent).value%>"></div>
                    <div class="txt">总盈利</div>
                </div>
                <div class="profit-wrap<%=Number(data.earningsExplain.lossProfit)?"":" lower-png"%>">
                    <div class="loss-column radius-t" style="height:<%=data.earningsExplain.percent.lossCountPercent%>%"></div>

                    

                    <div class="loss-most<%=dataHandling.percentOptimize(data.earningsExplain.percent.lossCountPercent,data.earningsExplain.percent.lossPercent).className%>" style="height:<%=dataHandling.percentOptimize(data.earningsExplain.percent.lossCountPercent,data.earningsExplain.percent.lossPercent).value%>"></div>
                    <div class="txt">总亏损</div>
                </div>
                <div class="loss-info info half-line">
                    <%if(Number(data.earningsExplain.lossProfit)){%>
                        <div class="profit-tab half-line-bottom">
                            <span>亏损最多</span><%=data.earningsExplain.productInfo.minTradingName%>
                        </div>
                        <p><%=data.earningsExplain.productInfo.minProfitValue%></p>  
                        <div class="triangle"></div>                                      
                    <%}else{%>
                        <div class="profit-tab half-line-bottom align-center">
                            期间暂无亏损
                        </div>
                        <p class="align-center color-999">0.00</p>  
                        <div class="triangle"></div>                                      
                    <%}%>

                </div>
            </div>
        </div>
        <div class="detail">
            <div class="btn switch-more"></div>
            <ul class="left">
                <li class="caption">期间持仓</li>
                <%_.each(data.earningsExplain.list,function(item,i){if(i<5){%>
                    <li class="item half-line-bottom" data-url="stockDetail" data-index="<%=i%>">
                        <div class="info<%=item.stockName.length>7?" font13":""%>">
                            <%=item.stockName%>
                            <div class="code">
                                <%=item.stockCode%>
                                <%if(dataHandling.getFuse(item.source)){%>
                                    <span class="fuse"></span>
                                <%}%>
                            </div>
                        </div>
                    </li>
                <%}})%>
            </ul>
            <div class="right swiper-container">
                <div class="swiper-wrapper">
                    <div class="swiper-slide">
                        <ul class="info">
                            <li class="caption">
                                <div class="title">收益率</div>
                                <div class="title">盈亏金额</div>
                            </li>
                            <%_.each(data.earningsExplain.list,function(item,i){if(i<5){%>
                            <li class="item half-line-bottom" data-url="stockDetail" data-index="<%=i%>">
                                <div class="value"><%=item.theYield%></div>
                                <div class="value"><span class='<%item.amount.indexOf("-")!=-1?print("loss"):print("profit") %>'><%=item.amount%></span></div>
                            </li>
                            <%}})%> 
                        </ul>
                    </div>
                    <div class="swiper-slide">
                        <ul class="info">
                            <li class="caption">
                                <div class="title">持仓天数</div>
                                <div class="title">交易次数</div>
                            </li>
                            <%_.each(data.earningsExplain.list,function(item,i){if(i<5){%>
                            <li class="item half-line-bottom" data-url="stockDetail" data-index="<%=i%>">
                                <div class="value"><%=item.days%></div>
                                <div class="value"><%=item.transactionNum%></div>
                            </li>                                        
                            <%}})%>    
                        </ul>
                    </div>
                </div>
            </div>
        </div>
        <%if(data.earningsExplain.list.length>5){%>
            <span class="btn more" data-url="incomeAnalysisUrl">点击查看更多</span>
        <%}%>        
    </div>
    <div class="search bottom-line">
        <div class="label">
            <span class="tip">快速分析任意持仓股票</span>
        </div>
        <div class="search-box" data-url="searchUrl">
            请输入股票代码或股票名称
        </div>
    </div>
    <div class="second-screen no-line">
        <div class="mask-loading"></div>    
         <%if(data.isCacheKline=="1"){%>
            <div class="business-analysis bottom-line">
                <div class="label">
                    <span class="title">买卖点分析</span>
                </div>
                <div class="tab">
                    <ul class="tab-list">
                        <li class="item<%data.riseType===0 && print(" cur")%>">对比上证</li>
                        <li class="item<%data.riseType===1 && print(" cur")%>">对比深证</li>
                    </ul>
                    <ul class="legend">
                        <li class="one">买入点</li>
                        <li class="two">卖出点</li>
                    </ul>
                </div>
                <div class="tab-pannel">
                    <div class="item">
                        <div class="canvas-wrap">
                            <div id="shanghai-canvas" class="canvas-dom half-line"></div>
                        </div>
                        <div class="info half-line"> 
                        </div>                        
                    </div>
                </div>
            </div>
        <%} else {%>
		    <div class="member" data-url="memberDetail">
		        <img src="images/upgrade-member.png"/>
            </div>
        <%}%>      
    </div>
    <footer class="main-footer">
        <div class="txt"><font class="pingfang-sc-medium tip">【风险揭示】</font>由于时间跨度、手续费及分红、转增、配股到账时间等原因，可能导致本功能数据不准确。以上数据仅供参考，不作为您投资决策依据，最终以实际交割单为准。市场有风险，投资需谨慎。</div>
    </footer>
    <%}%>
</article>
</script>

<script type="tpl/javascript" id="member-screen-tpl">
<div class="business-analysis">
    <div class="label">
        <span class="title">买卖点分析</span>
    </div>
    <div class="tab">
        <ul class="tab-list">
            <li class="item<%data.riseType===0 && print(" cur")%>">对比上证</li>
            <li class="item<%data.riseType===1 && print(" cur")%>">对比深证</li>
        </ul>
        <ul class="legend">
            <li class="one">买入点</li>
            <li class="two">卖出点</li>
        </ul>
    </div>
    <div class="tab-pannel">
        <div class="item">
            <div class="canvas-wrap">
                <div class="name">上证指数</div>
                <div class="more-txt">滑动查看</div>
                <div class="line hidden"></div>
                <div class="date-bar hidden"></div>
                <div id="shanghai-canvas" class="canvas-dom half-line"></div>
            </div>
            <div class="info half-line">
            <%if(!data.minPoint){%>
            <div class="empty">
                <p>在此期间内，暂无买卖操作</p>
            </div>                             
            <%}else{%>
            <div class="about">
                <ul class="summarize half-line-bottom">
                    <li>
                        <%=data.riseType===0?"上证指数":"深证指数"%>
                        <div class="value<%=dataHandling.getShareClass(data[0].firstData.range)%>"><%=data[0].firstData.range%></div>
                    </li>
                    <li class="half-line-left">
                        当日盈亏金额
                        <div class="value<%=dataHandling.getShareClass(data[0].firstData.profitLoss)%>"><%=data[0].firstData.profitLoss%><%=data.currency%></div>
                    </li>
                </ul>
                <p class="total-info">共交易<%=data[0].firstData.tradeNum%>次：<%=data[0].firstData.buyNum%>次买入，<%=data[0].firstData.sellNum%>次卖出</p>
                <ul class="detail"> 
                    <%_.each(data[0].firstData.list,function(item,index){if(index<3){%>
                    <li class="half-line-bottom" data-url="buyStockDetail" data-index="<%=index%>">
                        <div class="status half-line color-<%=item.typeFlag%>"><font class="pingfang-sc-medium <%=item.type.length>3?'font10':''%>" ><%=item.type%></font></div>
                        <div class="name"><%=item.stockName%><%dataHandling.getFuse(item.source) && print('<span class="fuse"></span>')%></div>
                        <div class="price<%=item.price.length>5?" font13":""%>"><%=item.price%><%=data.currency%></div>
                        <div class="count<%=item.num.length>7?" font14":""%>"><%=dataHandling.cutstr(item.num,5,"...")%><%item.num && print(item.unit)%></div>
                    </li>      
                    <%}})%>                     
                </ul>
                <%if(data[0].firstData.list.length>3){%>
                    <span class="btn more" data-url="businessAnalysisUrl">查看所有买卖点明细</span>
                <%}%>                      
            </div> 
            <%}%> 
            </div>
        </div>
        <div class="item hidden">
            <div class="canvas-wrap">
                <div class="name">深证指数</div>
                <div class="more-txt">滑动查看</div>
                <div class="line hidden"></div>
                <div class="date-bar hidden"></div>
                <div id="shenzhen-canvas" class="canvas-dom half-line"></div>
            </div>
            <div class="info half-line">
            </div>
        </div>
    </div>
</div> 
</script>
<script type="tpl/javascript" id="second-screen-tpl"> 
<div class="kline-wrap">
<%if(data.isCacheKline=="1"){%>
    <div class="business-analysis">
        <div class="label">
            <span class="title">买卖点分析</span>
        </div>
        <div class="tab">
            <ul class="tab-list">
                <li class="item<%data.riseType===0 && print(" cur")%>">对比上证</li>
                <li class="item<%data.riseType===1 && print(" cur")%>">对比深证</li>
            </ul>
            <ul class="legend">
                <li class="one">买入点</li>
                <li class="two">卖出点</li>
            </ul>
        </div>
        <div class="tab-pannel">
            <div class="item">
                <div class="canvas-wrap">
                    <div class="name">上证指数</div>
                    <div class="more-txt">滑动查看</div>
                    <div class="line hidden"></div>
                    <div class="date-bar hidden"></div>
                    <div id="shanghai-canvas" class="canvas-dom half-line"></div>
                </div>
                <div class="info half-line">
                <%if(!data.minPoint){%>
                <div class="empty">
                    <p>在此期间内，暂无买卖操作</p>
                </div>                             
                <%}else{%>
                <div class="about">
                    <ul class="summarize half-line-bottom">
                        <li>
                            <%=data.riseType===0?"上证指数":"深证指数"%>
                            <div class="value<%=dataHandling.getShareClass(data[0].firstData.range)%>"><%=data[0].firstData.range%></div>
                        </li>
                        <li class="half-line-left">
                            当日盈亏金额
                            <div class="value<%=dataHandling.getShareClass(data[0].firstData.profitLoss)%>"><%=data[0].firstData.profitLoss%><%=data.currency%></div>
                        </li>
                    </ul>
                    <p class="total-info">共交易<%=data[0].firstData.tradeNum%>次：<%=data[0].firstData.buyNum%>次买入，<%=data[0].firstData.sellNum%>次卖出</p>
                    <ul class="detail"> 
                        <%_.each(data[0].firstData.list,function(item,index){if(index<3){%>
                        <li class="half-line-bottom" data-url="buyStockDetail" data-index="<%=index%>">
                            <div class="status half-line color-<%=item.typeFlag%>"><font class="pingfang-sc-medium  <%=item.type.length>3?'font10':''%>" ><%=item.type%></font></div>
                            <div class="name"><%=item.stockName%><%dataHandling.getFuse(item.source) && print('<span class="fuse"></span>')%></div>
                            <div class="price<%=item.price.length>5?" font13":""%>"><%=item.price%><%=data.currency%></div>
                            <div class="count<%=item.num.length>7?" font14":""%>"><%=dataHandling.cutstr(item.num,5,"...")%><%item.num && print(item.unit)%></div>
                        </li>      
                        <%}})%>                     
                    </ul>
                    <%if(data[0].firstData.list.length>3){%>
                        <span class="btn more" data-url="businessAnalysisUrl">查看所有买卖点明细</span>
                    <%}%>                      
                </div> 
                <%}%> 
                </div>
            </div>
            <div class="item hidden">
                <div class="canvas-wrap">
                    <div class="name">深证指数</div>
                    <div class="more-txt">滑动查看</div>
                    <div class="line hidden"></div>
                    <div class="date-bar hidden"></div>
                    <div id="shenzhen-canvas" class="canvas-dom half-line"></div>
                </div>
                <div class="info half-line">
                </div>
            </div>
        </div>
    </div>
<%} else {%>
    <div class="member" data-url="memberDetail">
        <img src="images/upgrade-member.png"/>
    </div>
<%}%>
</div>
<%if(data.industryDistribution.list){%>
<div class="industrial-distribution">
    <div class="label">
        <span class="title">行业分布</span>
        <div class="content align-left">期间共操作 <%=data.industryDistribution.totalNum%> 只股票，其中 <span class="txt"><%=data.pieDataList%>。</span></div>
    </div>
    <div class="legend">
        <div class="left">
            <div class="txt">偏好<br/><%=data.industryDistribution.list[0].name%></div>        
            <div id="pie-canvas" class="pie-canvas"></div>
        </div>
        <ul class="right">
            <%_.each(data.pieData,function(item,index){%>
            <li class="item <%=dataHandling.numberToEn(index+1)%>">
                <div class="name"><%=item.name%></div>
                <div class="percent"><%=item.value.toFixed(2)%>%</div>
            </li>
            <%})%>
        </ul>
    </div>
</div>
<%}%>
</script>

<script type="tpl/javascript" id="trade-list-tpl">
<%if(!data.list.length){%>
<div class="empty">
    <p>在此期间内，暂无买卖操作</p>
</div>    
<%}else{%>
<div class="about">
    <ul class="summarize half-line-bottom">
        <li>
            <%=data.riseType===0?"上证指数":"深证指数"%>
            <div class="value<%=dataHandling.getShareClass(data.range)%>"><%=data.range%></div>
        </li>
        <li class="half-line-left">
            当日盈亏金额            
            <div class="value<%=dataHandling.getShareClass(data.profitLoss)%>"><%=data.profitLoss%><%=data.currency%></div>
        </li>
    </ul>
    <p class="total-info">共交易<%=data.tradeNum%>次：<%=data.buyNum%>次买入，<%=data.sellNum%>次卖出</p>
    <ul class="detail"> 
        <%_.each(data.list,function(item,index){if(index<3){%>
        <li class="half-line-bottom" data-url="buyStockDetail"  data-index="<%=index%>">
            <div class="status half-line color-<%=item.typeFlag%>"><font class="pingfang-sc-medium  <%=item.type.length>3?'font10':''%>" ><%=item.type%></font></div>
            <div class="name"><%=item.stockName%><%dataHandling.getFuse(item.source) && print('<span class="fuse"></span>')%></div>
            <div class="price<%=item.price.length>5?" font13":""%>"><%=item.price%><%=data.currency%></div>
            <div class="count<%=item.num.length>7?" font14":""%>"><%=dataHandling.cutstr(item.num,5,"...")%><%item.num && print(item.unit)%></div>
        </li>      
        <%}})%>    
    </ul>

    <%if(data.list.length>3){%>
        <span class="btn more" data-url="businessAnalysisUrl">查看所有买卖点明细</span>
    <%}%>           
</div> 
<%}%>   
</script>
</html>